package bsts.view.subscription;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;

import bsts.application.BSTSApplication;

public class ViewCustomersWindowForSubscription extends JFrame {

	private static final long serialVersionUID = 1L;

	private BSTSApplication manager;
	private JFrame me;
	private ViewCustomersPanelForSubscription viewCustomersPanelForSubscription;

	private WindowListener windowListener = new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			manager.getViewManager().goBackMain(me);
		}
	};

	public ViewCustomersWindowForSubscription(BSTSApplication manager) {
		super("BSTS - View Customers");
		this.manager = manager;
		this.me = this;

		viewCustomersPanelForSubscription = new ViewCustomersPanelForSubscription(me, manager);
		viewCustomersPanelForSubscription.refreshTbl();

		this.setLayout(new BorderLayout());
		this.add(viewCustomersPanelForSubscription, BorderLayout.CENTER);
		this.addWindowListener(windowListener);
	}

}
